package com.mvu.banana.user.client;

import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.TextColumn;
import com.mvu.banana.common.client.UiOut;
import com.mvu.banana.domain.client.MyConstants;

/**
 */
public class ProfileList extends CellTable<ProfileDTO> {
  /** @see com.mvu.banana.domain.stub.Profile#getName() **/
  String name;
  /** @see com.mvu.banana.domain.stub.Profile#getGender() **/
  String gender;
  @UiOut
  int age;

  public ProfileList() {
    TextColumn<ProfileDTO> nameColumn = new TextColumn<ProfileDTO>(){
      @Override
      public String getValue(ProfileDTO object) {
        return object.name;
      }
    };
    TextColumn<ProfileDTO> genderColumn = new TextColumn<ProfileDTO>(){
      @Override
      public String getValue(ProfileDTO object) {
        return MyConstants.get.getString(object.gender.name());
      }
    };
    addColumn(nameColumn, MyConstants.get.name());
    addColumn(genderColumn, MyConstants.get.gender());
  }
}
